﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="insuranceRates.aspx.cs" Inherits="WebApplication1.insuranceRates" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        #form1
        {
            height: 1px;
        }
    </style>
</head>
<body bgcolor="white">
    <form id="form1" runat="server">
    <img src="2.jpg" style="height: 197px; width: 1394px" align="centr">
    <h2 style="color: #0000FF">
        <asp:HyperLink ID="HyperLink2" runat="server" allign="left" NavigateUrl="~/Main.aspx">&lt;&lt;На главную</asp:HyperLink>
    </h2>
    <h2>
        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
            DataKeyNames="Id" DataSourceID="SqlDataSource1" Font-Size="Large" ForeColor="#000099"
            BackColor="Yellow" >
            <Columns>
                <asp:CommandField ShowEditButton="True" ShowDeleteButton="false" ShowSelectButton="false" />
                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="true" Visible ="false"
                    SortExpression="Id" />            
                 <asp:BoundField DataField="fire" HeaderText="Коэффициент страхования от пожара" SortExpression="fire" />
                <asp:BoundField DataField="water" HeaderText="Коэффициент страхования от затопления" SortExpression="water" />
                <asp:BoundField DataField="robbery" HeaderText="Коэффициент страхования от ограбления" SortExpression="robbery" />
             </Columns>
            <SelectedRowStyle BackColor="#33CC33" />
        </asp:GridView>
        <asp:SqlDataSource
            ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
            SelectCommand="SELECT * FROM [pricePolis]" 
            
            UpdateCommand="UPDATE [pricePolis] SET [fire] = @fire, [water] = @water, [robbery] = @robbery WHERE [Id] = @Id" 
            onselecting="SqlDataSource1_Selecting">
           
            <UpdateParameters>
                    <asp:Parameter Name="Id" Type="Int32" />
                <asp:Parameter Name="fire" Type="Double" />
                <asp:Parameter Name="water" Type="Double" />
                <asp:Parameter Name="robbery" Type="Double" />
            </UpdateParameters>
            
        </asp:SqlDataSource>
       
    </h2>
    &nbsp;</form>
</body>
</html>

